package com.easylinkin.linkappapi.ruleengine.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.easylinkin.linkappapi.deviceunit.entity.DeviceUnit;
import com.easylinkin.linkappapi.intelligentrule.entity.IntelligentRuleExpression;
import com.easylinkin.linkappapi.taskscheduler.entity.JobEntity;

import java.util.Date;
import java.util.List;
import java.util.Set;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 规则触发器
 * </p>
 *
 * @author TongJie
 * @since 2020-08-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("rule_trigger")
@ApiModel("规则触发器实体类")
public class RuleTrigger extends Model<RuleTrigger> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("id")
    @ApiModelProperty(value = "主键", example = "")
    private String id;

    /**
     * 排序标记
     */
    @TableField("sort_flag")
    @ApiModelProperty(value = "排序标记", example = "")
    private String sortFlag;

    /**
     * 规则引擎id
     */
    @TableField("rule_engine_id")
    @ApiModelProperty(value = "规则引擎id", example = "")
    private String ruleEngineId;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @ApiModelProperty(value = "创建时间", example = "")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField("modify_time")
    @ApiModelProperty(value = "修改时间", example = "")
    private Date modifyTime;

    /**
     * 定时任务id
     */
    @TableField("job_entity_id")
    @ApiModelProperty(value = "定时任务id", example = "")
    private String jobEntityId;

    @TableField(exist = false)
    @ApiModelProperty(value = "定时任务实体", example = "")
    private JobEntity jobEntity;

    /**
     * 设备型号id
     */
    @TableField("device_unit_id")
    @ApiModelProperty(value = "设备型号id", example = "")
    private String deviceUnitId;

    /**
     * 新型号id
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "新型号id", example = "")
    private String newDeviceUnitId;


    @TableField(exist = false)
    private DeviceUnit deviceUnit;

    /**
     * 类型 1-属性规则 2-常规规则  3-定时触发
     */
    @TableField("type")
    @ApiModelProperty(value = "类型", example = "1")
    private Integer type;

    /**
     * 常规类型值  0-离线  1-上线
     */
    @TableField("common_rule_item")
    @ApiModelProperty(value = "常规类型值", example = "1")
    private Integer commonRuleItem;

    /**
     * 智能规则表达式
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "智能规则表达式", example = "")
    private List<IntelligentRuleExpression> intelligentRuleExpressionList;

    /**
     * 触发器关联设备
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "触发器关联设备", example = "")
    private List<RuleTriggerRefDevice> ruleTriggerRefDeviceList;

    /**
     * 规则引擎ids
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "", example = "")
    private Set<String> ruleEngineIds;
}
